package com.baobao.druid.controller;

import com.baobao.druid.domain.Student;
import com.baobao.druid.mapper.ds1.StudentMapper;
import com.baobao.druid.mapper.ds2.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author baobao
 * @create 2020-09-04 14:14
 * @description
 */
@RestController
@RequestMapping("druidtest")
public class DruidController {
    @Autowired
    private StudentMapper studentMapper;

    @Autowired
    private UserMapper userMapper;

    @GetMapping("students")
    public List<Student> listStudents(){
        return studentMapper.getAll();
    }

    @GetMapping("user/count")
    public int getUserCount(){
        return userMapper.getCount();
    }
}
